/*
  Fluid Forge - Theme & UI Bone Configuration
  1. THEMES: Native Fluid (Codex Studio Dark), Studio Pro Max (Deep Slate & Electric Indigo), & Pure Gradio
  2. UI BONES: Codex v1 (Compact Bento Grid Cockpit)
  3. Mobile-First Bottom Sheet & Touch Optimization
*/

/* ==========================================================================
   THEME 1: NATIVE FLUID / CODEX (1:1 Pristine Codex Studio Dark Theme)
   ========================================================================== */
:root.fluid-theme-codex,
html.fluid-theme-codex,
body.fluid-theme-codex,
body.fluid-theme-codex.dark,
.fluid-theme-codex,
.fluid-theme-codex .gradio-container,
.fluid-theme-codex #gradio-app,
.fluid-theme-codex gradio-app {
    /* Palette Tokens */
    --background-fill-primary: #181818 !important;
    --background-fill-secondary: #202020 !important;
    --body-background-fill: #181818 !important;
    --panel-background-fill: #202020 !important;
    --block-background-fill: #202020 !important;
    --input-background-fill: #272727 !important;
    --table-background-fill: #181818 !important;

    /* Background Override Variables */
    --bg-deep: #181818 !important;
    --bg-base: #181818 !important;
    --bg-elevated: #202020 !important;
    --surface: #252525 !important;
    --surface-hover: #303030 !important;

    /* Accent & Sliders */
    --accent: #ffffff !important;
    --accent-glow: rgba(255, 255, 255, 0.15) !important;
    --slider-color: #ffffff !important;
    --color-accent: #ffffff !important;
    --color-accent-soft: #2a2a2a !important;

    /* Borders */
    --border: #292929 !important;
    --border-hover: #404040 !important;
    --border-color-primary: #292929 !important;
    --border-color-accent: #333333 !important;
    --panel-border-color: #292929 !important;
    --block-border-color: #292929 !important;
    --input-border-color: #333333 !important;
    --input-border-color-focus: #555555 !important;

    /* Typography & Text */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", sans-serif !important;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", "Roboto Mono", monospace !important;
    --foreground: #e5e5e5 !important;
    --foreground-muted: #8e8e8e !important;
    --body-text-color: #e5e5e5 !important;
    --body-text-color-subdued: #8e8e8e !important;
    --block-label-text-color: #bebebe !important;
    --block-title-text-color: #ffffff !important;
    --input-placeholder-color: #737373 !important;
    --link-text-color: #3b82f6 !important;
    --link-text-color-hover: #60a5fa !important;

    /* Primary CTA */
    --button-primary-background-fill: #f4f4f4 !important;
    --button-primary-text-color: #181818 !important;
    --button-primary-border-color: #f4f4f4 !important;
    --button-primary-background-fill-hover: #ffffff !important;
    --button-primary-text-color-hover: #000000 !important;
    --button-primary-border-color-hover: #ffffff !important;

    /* Secondary CTA */
    --button-secondary-background-fill: #252525 !important;
    --button-secondary-text-color: #d4d4d4 !important;
    --button-secondary-border-color: #333333 !important;
    --button-secondary-background-fill-hover: #303030 !important;
    --button-secondary-text-color-hover: #ffffff !important;
    --button-secondary-border-color-hover: #484848 !important;

    /* Base Styling */
    background-color: #181818 !important;
    color: #e5e5e5 !important;
    font-family: var(--font) !important;
}

body.fluid-theme-codex,
html.fluid-theme-codex,
.fluid-theme-codex .gradio-container,
.fluid-theme-codex .dark,
.fluid-theme-codex #gradio-app,
.fluid-theme-codex .app,
.fluid-theme-codex gradio-app {
    background-color: #181818 !important;
    background: #181818 !important;
}

/* ==========================================================================
   THEME 2: STUDIO PRO MAX (Deep Slate Obsidian & Electric Indigo)
   ========================================================================== */
:root.fluid-theme-pro-max,
html.fluid-theme-pro-max,
body.fluid-theme-pro-max,
body.fluid-theme-pro-max.dark,
.fluid-theme-pro-max,
.fluid-theme-pro-max .gradio-container,
.fluid-theme-pro-max #gradio-app,
.fluid-theme-pro-max gradio-app {
    /* Palette Tokens */
    --background-fill-primary: #0b0d13 !important;
    --background-fill-secondary: #131722 !important;
    --body-background-fill: #0b0d13 !important;
    --panel-background-fill: #131722 !important;
    --block-background-fill: #131722 !important;
    --input-background-fill: #181d2c !important;
    --table-background-fill: #0b0d13 !important;

    /* Background Override Variables */
    --bg-deep: #08090d !important;
    --bg-base: #0b0d13 !important;
    --bg-elevated: #131722 !important;
    --surface: #191e2e !important;
    --surface-hover: #22293e !important;

    /* Accent & Sliders: Electric Indigo & Cyan */
    --accent: #6366f1 !important;
    --accent-glow: rgba(99, 102, 241, 0.35) !important;
    --slider-color: #6366f1 !important;
    --color-accent: #6366f1 !important;
    --color-accent-soft: rgba(99, 102, 241, 0.15) !important;

    /* Borders */
    --border: #232a3d !important;
    --border-hover: #37415c !important;
    --border-color-primary: #232a3d !important;
    --border-color-accent: #3b4666 !important;
    --panel-border-color: #232a3d !important;
    --block-border-color: #232a3d !important;
    --input-border-color: #2b344c !important;
    --input-border-color-focus: #6366f1 !important;

    /* Typography & Text */
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif !important;
    --font-mono: "SF Mono", "Geist Mono", "JetBrains Mono", ui-monospace, monospace !important;
    --foreground: #f1f5f9 !important;
    --foreground-muted: #94a3b8 !important;
    --body-text-color: #f1f5f9 !important;
    --body-text-color-subdued: #94a3b8 !important;
    --block-label-text-color: #cbd5e1 !important;
    --block-title-text-color: #ffffff !important;
    --input-placeholder-color: #64748b !important;
    --link-text-color: #6366f1 !important;
    --link-text-color-hover: #818cf8 !important;

    /* Primary CTA (Vibrant Electric Indigo Gradient) */
    --button-primary-background-fill: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    --button-primary-text-color: #ffffff !important;
    --button-primary-border-color: #6366f1 !important;
    --button-primary-background-fill-hover: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
    --button-primary-text-color-hover: #ffffff !important;
    --button-primary-border-color-hover: #818cf8 !important;

    /* Secondary CTA */
    --button-secondary-background-fill: #191e2e !important;
    --button-secondary-text-color: #e2e8f0 !important;
    --button-secondary-border-color: #2b344c !important;
    --button-secondary-background-fill-hover: #22293e !important;
    --button-secondary-text-color-hover: #ffffff !important;
    --button-secondary-border-color-hover: #475569 !important;

    /* Base Styling */
    background-color: #0b0d13 !important;
    color: #f1f5f9 !important;
    font-family: var(--font) !important;
}

body.fluid-theme-pro-max,
html.fluid-theme-pro-max,
.fluid-theme-pro-max .gradio-container,
.fluid-theme-pro-max .dark,
.fluid-theme-pro-max #gradio-app,
.fluid-theme-pro-max .app,
.fluid-theme-pro-max gradio-app {
    background-color: #0b0d13 !important;
    background: #0b0d13 !important;
}

/* ==========================================================================
   THEME 3: PURE GRADIO
   ========================================================================== */
.fluid-theme-pure-gradio {
    /* Pure native Gradio styling */
}

/* Monospace & Data Elements */
body.fluid-theme-codex input[type="number"],
body.fluid-theme-codex .gr-text-input[type="number"],
body.fluid-theme-codex .token-counter,
body.fluid-theme-codex .performance,
body.fluid-theme-codex code,
body.fluid-theme-codex pre,
body.fluid-theme-pro-max input[type="number"],
body.fluid-theme-pro-max .gr-text-input[type="number"],
body.fluid-theme-pro-max .token-counter,
body.fluid-theme-pro-max .performance,
body.fluid-theme-pro-max code,
body.fluid-theme-pro-max pre {
    font-family: var(--font-mono) !important;
}

/* Navigation Tabs (Codex) */
body.fluid-theme-codex .tabs > .tab-nav,
body.fluid-theme-codex .gradio-tabs > div.tab-nav {
    background: #181818 !important;
    border-bottom: 1px solid #292929 !important;
    gap: 4px !important;
    padding: 0 4px !important;
}

body.fluid-theme-codex .tabs > .tab-nav > button,
body.fluid-theme-codex .gradio-tabs > div.tab-nav > button {
    background: transparent !important;
    border: none !important;
    color: #8e8e8e !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
}

body.fluid-theme-codex .tabs > .tab-nav > button:hover,
body.fluid-theme-codex .gradio-tabs > div.tab-nav > button:hover {
    color: #ffffff !important;
    background: #202020 !important;
}

body.fluid-theme-codex .tabs > .tab-nav > button.selected,
body.fluid-theme-codex .gradio-tabs > div.tab-nav > button.selected {
    color: #ffffff !important;
    background: #303030 !important;
    font-weight: 600 !important;
}

/* Navigation Tabs (Studio Pro Max) */
body.fluid-theme-pro-max .tabs > .tab-nav,
body.fluid-theme-pro-max .gradio-tabs > div.tab-nav {
    background: #0b0d13 !important;
    border-bottom: 1px solid #232a3d !important;
    gap: 6px !important;
    padding: 0 6px !important;
}

body.fluid-theme-pro-max .tabs > .tab-nav > button,
body.fluid-theme-pro-max .gradio-tabs > div.tab-nav > button {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    border-radius: 7px !important;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.fluid-theme-pro-max .tabs > .tab-nav > button:hover,
body.fluid-theme-pro-max .gradio-tabs > div.tab-nav > button:hover {
    color: #f1f5f9 !important;
    background: #181d2c !important;
}

body.fluid-theme-pro-max .tabs > .tab-nav > button.selected,
body.fluid-theme-pro-max .gradio-tabs > div.tab-nav > button.selected {
    color: #ffffff !important;
    background: #6366f1 !important;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35) !important;
    font-weight: 600 !important;
}

/* Prompt Textareas (Codex) */
body.fluid-theme-codex #txt2img_prompt textarea,
body.fluid-theme-codex #img2img_prompt textarea,
body.fluid-theme-codex #txt2img_neg_prompt textarea,
body.fluid-theme-codex #img2img_neg_prompt textarea,
body.fluid-theme-codex textarea {
    background-color: #272727 !important;
    color: #f0f0f0 !important;
    border: 1px solid #333333 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
}

body.fluid-theme-codex textarea:focus {
    border-color: #555555 !important;
    background-color: #2a2a2a !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Prompt Textareas (Studio Pro Max) */
body.fluid-theme-pro-max #txt2img_prompt textarea,
body.fluid-theme-pro-max #img2img_prompt textarea,
body.fluid-theme-pro-max #txt2img_neg_prompt textarea,
body.fluid-theme-pro-max #img2img_neg_prompt textarea,
body.fluid-theme-pro-max textarea {
    background-color: #141824 !important;
    color: #f8fafc !important;
    border: 1px solid #283147 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    transition: all 0.15s ease !important;
}

body.fluid-theme-pro-max textarea:focus {
    border-color: #6366f1 !important;
    background-color: #181d2c !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    outline: none !important;
}

/* Sliders (Codex) */
body.fluid-theme-codex input[type="range"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: #333333 !important;
    height: 4px !important;
    border-radius: 2px !important;
    margin: 8px 0 !important;
    outline: none !important;
}

body.fluid-theme-codex input[type="range"]::-webkit-slider-runnable-track {
    background: #333333 !important;
    height: 4px !important;
    border-radius: 2px !important;
}

body.fluid-theme-codex input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 14px !important;
    width: 14px !important;
    background: #ffffff !important;
    border: 2px solid #181818 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    margin-top: -5px !important;
    transition: transform 0.15s ease !important;
}

body.fluid-theme-codex input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15) !important;
}

body.fluid-theme-codex input[type="range"]::-moz-range-thumb {
    height: 14px !important;
    width: 14px !important;
    background: #ffffff !important;
    border: 2px solid #181818 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

/* Sliders (Studio Pro Max) */
body.fluid-theme-pro-max input[type="range"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: #232a3d !important;
    height: 5px !important;
    border-radius: 3px !important;
    margin: 8px 0 !important;
    outline: none !important;
}

body.fluid-theme-pro-max input[type="range"]::-webkit-slider-runnable-track {
    background: #232a3d !important;
    height: 5px !important;
    border-radius: 3px !important;
}

body.fluid-theme-pro-max input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 15px !important;
    width: 15px !important;
    background: #6366f1 !important;
    border: 2px solid #0b0d13 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6) !important;
    margin-top: -5px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

body.fluid-theme-pro-max input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.9) !important;
}

body.fluid-theme-pro-max input[type="range"]::-moz-range-thumb {
    height: 15px !important;
    width: 15px !important;
    background: #6366f1 !important;
    border: 2px solid #0b0d13 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6) !important;
}

/* Dropdowns & Selects (Codex) */
body.fluid-theme-codex .gradio-dropdown,
body.fluid-theme-codex .gr-dropdown,
body.fluid-theme-codex select,
body.fluid-theme-codex .wrap-default {
    background-color: #272727 !important;
    color: #f0f0f0 !important;
    border: 1px solid #333333 !important;
    border-radius: 6px !important;
}

body.fluid-theme-codex .gr-dropdown-list,
body.fluid-theme-codex .options,
body.fluid-theme-codex ul.options,
body.fluid-theme-codex .gradio-dropdown ul {
    background-color: #2a2a2a !important;
    border: 1px solid #383838 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65) !important;
}

body.fluid-theme-codex .options li:hover,
body.fluid-theme-codex ul.options li:hover,
body.fluid-theme-codex .gradio-dropdown ul li:hover {
    background-color: #383838 !important;
    color: #ffffff !important;
}

/* Dropdowns & Selects (Studio Pro Max) */
body.fluid-theme-pro-max .gradio-dropdown,
body.fluid-theme-pro-max .gr-dropdown,
body.fluid-theme-pro-max select,
body.fluid-theme-pro-max .wrap-default {
    background-color: #181d2c !important;
    color: #f1f5f9 !important;
    border: 1px solid #2b344c !important;
    border-radius: 7px !important;
}

body.fluid-theme-pro-max .gr-dropdown-list,
body.fluid-theme-pro-max .options,
body.fluid-theme-pro-max ul.options,
body.fluid-theme-pro-max .gradio-dropdown ul {
    background-color: #151a28 !important;
    border: 1px solid #313c58 !important;
    border-radius: 9px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75) !important;
}

body.fluid-theme-pro-max .options li:hover,
body.fluid-theme-pro-max ul.options li:hover,
body.fluid-theme-pro-max .gradio-dropdown ul li:hover {
    background-color: #22293e !important;
    color: #6366f1 !important;
}

/* Primary Action CTA (Generate Button - Codex) */
body.fluid-theme-codex button.primary,
body.fluid-theme-codex #txt2img_generate,
body.fluid-theme-codex #img2img_generate {
    background: #f4f4f4 !important;
    color: #181818 !important;
    border: 1px solid #f4f4f4 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
}

body.fluid-theme-codex button.primary:hover,
body.fluid-theme-codex #txt2img_generate:hover,
body.fluid-theme-codex #img2img_generate:hover {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15) !important;
}

/* Primary Action CTA (Generate Button - Studio Pro Max) */
body.fluid-theme-pro-max button.primary,
body.fluid-theme-pro-max #txt2img_generate,
body.fluid-theme-pro-max #img2img_generate {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    border: 1px solid #6366f1 !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
}

body.fluid-theme-pro-max button.primary:hover,
body.fluid-theme-pro-max #txt2img_generate:hover,
body.fluid-theme-pro-max #img2img_generate:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55) !important;
    transform: translateY(-1px) !important;
}

/* Secondary Buttons (Codex) */
body.fluid-theme-codex button.secondary,
body.fluid-theme-codex .gr-button-secondary,
body.fluid-theme-codex .tool,
body.fluid-theme-codex button:not(.primary):not(#txt2img_generate):not(#img2img_generate):not(#txt2img_interrupt):not(#img2img_interrupt):not(#txt2img_skip):not(#img2img_skip):not(.fluid-float-action-btn) {
    background: #252525 !important;
    color: #d4d4d4 !important;
    border: 1px solid #333333 !important;
    border-radius: 6px !important;
}

body.fluid-theme-codex button.secondary:hover,
body.fluid-theme-codex .tool:hover {
    background: #303030 !important;
    color: #ffffff !important;
    border-color: #484848 !important;
}

/* Secondary Buttons (Studio Pro Max) */
body.fluid-theme-pro-max button.secondary,
body.fluid-theme-pro-max .gr-button-secondary,
body.fluid-theme-pro-max .tool,
body.fluid-theme-pro-max button:not(.primary):not(#txt2img_generate):not(#img2img_generate):not(#txt2img_interrupt):not(#img2img_interrupt):not(#txt2img_skip):not(#img2img_skip):not(.fluid-float-action-btn) {
    background: #191e2e !important;
    color: #e2e8f0 !important;
    border: 1px solid #2b344c !important;
    border-radius: 7px !important;
}

body.fluid-theme-pro-max button.secondary:hover,
body.fluid-theme-pro-max .tool:hover {
    background: #22293e !important;
    color: #ffffff !important;
    border-color: #435174 !important;
}

/* Custom Scrollbars (Codex & Pro Max) */
body.fluid-theme-codex ::-webkit-scrollbar,
body.fluid-theme-pro-max ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
body.fluid-theme-codex ::-webkit-scrollbar-track {
    background: #181818;
}
body.fluid-theme-pro-max ::-webkit-scrollbar-track {
    background: #0b0d13;
}
body.fluid-theme-codex ::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 9999px;
}
body.fluid-theme-pro-max ::-webkit-scrollbar-thumb {
    background: #2b344c;
    border-radius: 9999px;
}
body.fluid-theme-pro-max ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}


/* ==========================================================================
   UI BONE: CODEX V1 (BENTO COCKPIT GRID ARCHITECTURE)
   ========================================================================== */
body.fluid-bone-codex-v1 .fluid-cockpit-grid {
    display: grid !important;
    grid-template-columns: 1.1fr 1.2fr 0.9fr !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
    width: 100% !important;
}

/* UI Hide: Hide Seed & Batching Card */
body.fluid-hide-seed-batch .card-seed,
body.fluid-hide-seed-batch .fluid-bento-card.card-seed,
.fluid-hide-seed-batch .card-seed,
.fluid-hide-seed-batch .fluid-bento-card.card-seed {
    display: none !important;
}

body.fluid-hide-seed-batch.fluid-bone-codex-v1 .fluid-cockpit-grid,
.fluid-hide-seed-batch.fluid-bone-codex-v1 .fluid-cockpit-grid {
    grid-template-columns: 1fr 1fr !important;
}

@media (max-width: 1150px) {
    body.fluid-bone-codex-v1 .fluid-cockpit-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 992px), (max-width: 768px) {
    body.fluid-bone-codex-v1 .fluid-cockpit-grid,
    body.fluid-hide-seed-batch.fluid-bone-codex-v1 .fluid-cockpit-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Bento Card Structural Styling */
.fluid-bento-card {
    border-radius: 8px !important;
    padding: 8px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    background: var(--panel-background-fill, var(--block-background-fill, var(--background-fill-secondary))) !important;
    border: 1px solid var(--panel-border-color, var(--block-border-color, var(--border-color-primary))) !important;
}

body.fluid-theme-codex .fluid-bento-card {
    background: #202020 !important;
    border: 1px solid #292929 !important;
}

body.fluid-theme-pro-max .fluid-bento-card {
    background: #131722 !important;
    border: 1px solid #232a3d !important;
}

.fluid-bento-title {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding-bottom: 4px !important;
    margin-bottom: 2px !important;
    color: var(--block-label-text-color, var(--body-text-color-subdued, #888888)) !important;
    border-bottom: 1px solid var(--border-color-primary, rgba(128, 128, 128, 0.2)) !important;
}

body.fluid-theme-codex .fluid-bento-title {
    color: #737373 !important;
    border-bottom: 1px solid #282828 !important;
}

body.fluid-theme-pro-max .fluid-bento-title {
    color: #94a3b8 !important;
    border-bottom: 1px solid #202738 !important;
}

.fluid-bento-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* Sampling Dropdowns Side-by-Side */
.fluid-sampling-drop-row {
    display: flex !important;
    gap: 6px !important;
}

.fluid-sampling-drop-row > * {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Aspect Ratio Bar & Quick Matrix */
.fluid-cockpit-aspect-bar {
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--input-background-fill, var(--background-fill-secondary, transparent));
    border: 1px solid var(--border-color-primary, rgba(128, 128, 128, 0.2));
}

body.fluid-theme-codex .fluid-cockpit-aspect-bar {
    background: #272727;
    border: 1px solid #333333;
}

body.fluid-theme-pro-max .fluid-cockpit-aspect-bar {
    background: #181d2c;
    border: 1px solid #283147;
}

.fluid-aspect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fluid-aspect-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.fluid-ratio-pill {
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary));
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary));
    color: var(--button-secondary-text-color, var(--body-text-color));
}

.fluid-ratio-pill:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary));
}

.fluid-ratio-pill.active {
    background: var(--button-primary-background-fill, var(--primary-500, #ff7c00));
    color: var(--button-primary-text-color, #ffffff);
    border-color: var(--button-primary-border-color, transparent);
}

body.fluid-theme-codex .fluid-ratio-pill {
    background: #202020;
    border: 1px solid #333333;
    color: #a0a0a0;
}

body.fluid-theme-codex .fluid-ratio-pill:hover,
body.fluid-theme-codex .fluid-ratio-pill.active {
    background: #383838;
    color: #ffffff;
    border-color: #555555;
}

body.fluid-theme-pro-max .fluid-ratio-pill {
    background: #141824;
    border: 1px solid #283147;
    color: #cbd5e1;
}

body.fluid-theme-pro-max .fluid-ratio-pill:hover {
    background: #22293e;
    color: #ffffff;
}

body.fluid-theme-pro-max .fluid-ratio-pill.active {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.fluid-aspect-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fluid-base-picker {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--body-text-color-subdued, #888888);
}

body.fluid-theme-codex .fluid-base-picker {
    color: #737373;
}

body.fluid-theme-pro-max .fluid-base-picker {
    color: #94a3b8;
}

.fluid-base-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.fluid-base-pill {
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary));
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary));
    color: var(--button-secondary-text-color, var(--body-text-color-subdued));
}

.fluid-base-pill:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary));
}

.fluid-base-pill.active {
    background: var(--button-primary-background-fill, var(--primary-500, #ff7c00));
    color: var(--button-primary-text-color, #ffffff);
    border-color: var(--button-primary-border-color, transparent);
}

body.fluid-theme-codex .fluid-base-pill {
    background: #202020;
    border: 1px solid #333333;
    color: #8e8e8e;
}

body.fluid-theme-codex .fluid-base-pill:hover,
body.fluid-theme-codex .fluid-base-pill.active {
    background: #383838;
    color: #ffffff;
    border-color: #555555;
}

body.fluid-theme-pro-max .fluid-base-pill {
    background: #141824;
    border: 1px solid #283147;
    color: #94a3b8;
}

body.fluid-theme-pro-max .fluid-base-pill:hover,
body.fluid-theme-pro-max .fluid-base-pill.active {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
}

.fluid-aspect-lock {
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary));
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary));
    color: var(--body-text-color);
}

.fluid-aspect-lock.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

body.fluid-theme-codex .fluid-aspect-lock {
    background: #202020;
    border: 1px solid #333333;
}

body.fluid-theme-codex .fluid-aspect-lock.active {
    background: #1a2e1d;
    border-color: #22c55e;
    color: #22c55e;
}

body.fluid-theme-pro-max .fluid-aspect-lock {
    background: #141824;
    border: 1px solid #283147;
    color: #cbd5e1;
}

body.fluid-theme-pro-max .fluid-aspect-lock.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

/* Dimensions Sliders Row */
.fluid-dim-sliders-row {
    display: flex !important;
    align-items: flex-end !important;
    gap: 6px !important;
}

.fluid-dim-sliders-row > .gradio-slider,
.fluid-dim-sliders-row > div:not(#txt2img_res_switch_btn):not(#img2img_res_switch_btn) {
    flex: 1 !important;
    min-width: 0 !important;
}

#txt2img_res_switch_btn,
#img2img_res_switch_btn {
    flex: 0 0 28px !important;
    height: 28px !important;
    margin-bottom: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary)) !important;
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
    color: var(--button-secondary-text-color, var(--body-text-color)) !important;
}

body.fluid-theme-codex #txt2img_res_switch_btn,
body.fluid-theme-codex #img2img_res_switch_btn {
    background: #272727 !important;
    border: 1px solid #333333 !important;
    color: #d4d4d4 !important;
}

body.fluid-theme-pro-max #txt2img_res_switch_btn,
body.fluid-theme-pro-max #img2img_res_switch_btn {
    background: #181d2c !important;
    border: 1px solid #283147 !important;
    color: #cbd5e1 !important;
}

/* Live Resolution Badge */
.fluid-res-badge {
    font-size: 11px;
    text-align: center;
    border-radius: 6px;
    padding: 4px 6px;
    background: var(--input-background-fill, var(--background-fill-secondary));
    border: 1px solid var(--border-color-primary, rgba(128, 128, 128, 0.2));
    color: var(--body-text-color-subdued, #888888);
}

body.fluid-theme-codex .fluid-res-badge {
    background: #272727;
    border: 1px solid #333333;
    color: #737373;
}

body.fluid-theme-pro-max .fluid-res-badge {
    background: #141824;
    border: 1px solid #283147;
    color: #94a3b8;
}

.fluid-res-dim {
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    color: var(--body-text-color, #ffffff);
}

body.fluid-theme-codex .fluid-res-dim {
    color: #ffffff;
}

body.fluid-theme-pro-max .fluid-res-dim {
    color: #f8fafc;
}

.fluid-res-mp {
    color: var(--body-text-color-subdued, #a0a0a0);
}

.fluid-res-vram {
    color: #f59e0b;
    font-weight: 500;
}

/* Micro-Steppers for Batching */
.fluid-stepper-btn {
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 3px;
    transition: all 0.12s ease;
    vertical-align: middle;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary));
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary));
    color: var(--button-secondary-text-color, var(--body-text-color));
}

.fluid-stepper-btn:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary));
}

body.fluid-theme-codex .fluid-stepper-btn {
    background: #272727;
    border: 1px solid #333333;
    color: #d4d4d4;
}

body.fluid-theme-codex .fluid-stepper-btn:hover {
    background: #383838;
    color: #ffffff;
    border-color: #555555;
}

body.fluid-theme-pro-max .fluid-stepper-btn {
    background: #181d2c;
    border: 1px solid #283147;
    color: #cbd5e1;
}

body.fluid-theme-pro-max .fluid-stepper-btn:hover {
    background: #22293e;
    color: #ffffff;
    border-color: #6366f1;
}

/* Hide Batch Count & Size in Codex v1 Bento Grid */
body.fluid-bone-codex-v1 [id*="_batch_count"],
body.fluid-bone-codex-v1 [id*="_batch_size"],
body.fluid-bone-codex-v1 #txt2img_batch_count,
body.fluid-bone-codex-v1 #txt2img_batch_size,
body.fluid-bone-codex-v1 #img2img_batch_count,
body.fluid-bone-codex-v1 #img2img_batch_size {
    display: none !important;
}

/* ==========================================================================
   UNIFIED QUICK MODULES DOCK (ZERO STACK CHIP DOCK)
   ========================================================================== */
.fluid-accordion-dock {
    border-radius: 9px !important;
    padding: 9px 12px !important;
    margin: 6px 0 8px 0 !important;
    width: 100% !important;
    background: var(--panel-background-fill, var(--block-background-fill, var(--background-fill-secondary))) !important;
    border: 1px solid var(--panel-border-color, var(--block-border-color, var(--border-color-primary))) !important;
}

body.fluid-theme-codex .fluid-accordion-dock {
    background: #1c1c1c !important;
    border: 1px solid #282828 !important;
}

body.fluid-theme-pro-max .fluid-accordion-dock {
    background: #10141e !important;
    border: 1px solid #232a3d !important;
}

.fluid-dock-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
    padding-bottom: 5px !important;
    border-bottom: 1px solid var(--border-color-primary, rgba(128, 128, 128, 0.2)) !important;
}

body.fluid-theme-codex .fluid-dock-header {
    border-bottom: 1px solid #242424 !important;
}

body.fluid-theme-pro-max .fluid-dock-header {
    border-bottom: 1px solid #1f2535 !important;
}

.fluid-dock-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--block-label-text-color, var(--body-text-color-subdued, #888888)) !important;
}

body.fluid-theme-codex .fluid-dock-title {
    color: #737373 !important;
}

body.fluid-theme-pro-max .fluid-dock-title {
    color: #94a3b8 !important;
}

.fluid-dock-badge {
    font-size: 10px !important;
    font-family: var(--font-mono, monospace) !important;
    color: var(--body-text-color-subdued, #888888) !important;
}

body.fluid-theme-codex .fluid-dock-badge {
    color: #555555 !important;
}

body.fluid-theme-pro-max .fluid-dock-badge {
    color: #64748b !important;
}

.fluid-dock-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
}

.fluid-dock-chip {
    border-radius: 7px !important;
    padding: 5px 12px !important;
    min-height: 30px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    box-sizing: border-box !important;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary)) !important;
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
    color: var(--button-secondary-text-color, var(--body-text-color)) !important;
}

.fluid-dock-chip:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary)) !important;
}

.fluid-dock-chip.panel-open {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary)) !important;
    color: var(--body-text-color, #ffffff) !important;
    border-color: var(--border-color-accent, var(--primary-500, #ff7c00)) !important;
    font-weight: 600 !important;
}

.fluid-dock-chip.is-enabled {
    border-color: rgba(34, 197, 94, 0.5) !important;
}

body.fluid-theme-codex .fluid-dock-chip {
    background: #232323 !important;
    border: 1px solid #303030 !important;
    color: #a8a8a8 !important;
}

body.fluid-theme-codex .fluid-dock-chip:hover {
    background: #2c2c2c !important;
    color: #ffffff !important;
    border-color: #444444 !important;
}

body.fluid-theme-codex .fluid-dock-chip.panel-open {
    background: #333333 !important;
    color: #ffffff !important;
    border-color: #666666 !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.12) !important;
}

body.fluid-theme-pro-max .fluid-dock-chip {
    background: #161b27 !important;
    border: 1px solid #283147 !important;
    color: #94a3b8 !important;
}

body.fluid-theme-pro-max .fluid-dock-chip:hover {
    background: #202738 !important;
    color: #f1f5f9 !important;
    border-color: #3b4666 !important;
}

body.fluid-theme-pro-max .fluid-dock-chip.panel-open {
    background: #202738 !important;
    color: #ffffff !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.35) !important;
}

.fluid-chip-title {
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

/* Quick Shortcut Buttons on Special Chips (e.g. Torch Compile) */
.fluid-chip-shortcuts {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: 6px !important;
}

.fluid-chip-sub-btn {
    border-radius: 5px !important;
    padding: 2px 7px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
    background: var(--input-background-fill, var(--background-fill-primary)) !important;
    border: 1px solid var(--border-color-primary) !important;
    color: var(--body-text-color-subdued, #888888) !important;
}

.fluid-chip-sub-btn:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-secondary)) !important;
}

.fluid-chip-sub-btn.active {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: #22c55e !important;
    color: #22c55e !important;
    font-weight: 700 !important;
}

body.fluid-theme-codex .fluid-chip-sub-btn {
    background: #181818 !important;
    border: 1px solid #383838 !important;
    color: #9e9e9e !important;
}

body.fluid-theme-codex .fluid-chip-sub-btn:hover {
    background: #282828 !important;
    color: #ffffff !important;
    border-color: #555555 !important;
}

body.fluid-theme-codex .fluid-chip-sub-btn.active {
    background: #143321 !important;
    border-color: #22c55e !important;
    color: #4ade80 !important;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4) !important;
}

body.fluid-theme-pro-max .fluid-chip-sub-btn {
    background: #0f121b !important;
    border: 1px solid #232a3d !important;
    color: #94a3b8 !important;
}

body.fluid-theme-pro-max .fluid-chip-sub-btn:hover {
    background: #1c2232 !important;
    color: #ffffff !important;
    border-color: #3b4666 !important;
}

body.fluid-theme-pro-max .fluid-chip-sub-btn.active {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4) !important;
}

.fluid-chip-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    position: relative !important;
    background: var(--border-color-primary, #6b7280) !important;
    border: 1px solid var(--border-color-accent, #9ca3af) !important;
}

body.fluid-theme-codex .fluid-chip-dot {
    background: #484848 !important;
    border: 1px solid #5a5a5a !important;
}

body.fluid-theme-pro-max .fluid-chip-dot {
    background: #2b344c !important;
    border: 1px solid #414e70 !important;
}

.fluid-chip-dot::before {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: -6px;
    right: -6px;
}

.fluid-chip-dot:hover {
    transform: scale(1.18) !important;
}

.fluid-chip-dot.active {
    background: #10b981 !important;
    border-color: #059669 !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.85) !important;
}

.fluid-chip-dot.active:hover {
    box-shadow: 0 0 10px rgba(16, 185, 129, 1) !important;
}

/* ==========================================================================
   UNIFIED PROMPT & TOOLS ACCORDION / TOGGLE MICRO-DESIGN SYSTEM
   Standardizes all 5 stacked prompt/tool/parameter control bars:
   1. Positive Prompt Accordion (details.custom-prompt-accordion > summary)
   2. Negative Prompt Collapse (.np-wrap .np-toggle)
   3. Segmented Prompt Builder (#segmented_prompt_accordion_* > .label-wrap)
   4. Configure Parameters Mobile Toggle (.fluid-mobile-toggle)
   5. Tools Collapse Button (#txt2img_collapse_btn, #img2img_collapse_btn)
   ========================================================================== */

/* Universal Strip Dimensions, Reset & Layout */
details.custom-prompt-accordion > summary,
.np-wrap.collapsed .np-toggle,
.np-wrap:not(.collapsed) .np-bar,
.np-toggle,
#segmented_prompt_accordion_txt2img > .label-wrap,
#segmented_prompt_accordion_img2img > .label-wrap,
.fluid-mobile-toggle,
#txt2img_collapse_btn,
#img2img_collapse_btn {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 12px !important;
    margin: 4px 0 !important;
    border-radius: 7px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.025em !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    user-select: none !important;
    outline: none !important;
    text-align: center !important;
    list-style: none !important;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Details Summary Reset */
details.custom-prompt-accordion > summary::-webkit-details-marker {
    display: none !important;
}

details.custom-prompt-accordion > summary b,
details.custom-prompt-accordion > summary span {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.025em !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
}

/* Negative Prompt Container Overrides */
.np-wrap.collapsed {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

.np-wrap:not(.collapsed) {
    margin: 4px 0 !important;
    padding: 4px !important;
    border-radius: 8px !important;
}

.np-wrap .np-bar {
    padding: 0 !important;
    margin: 0 !important;
}

/* Segmented Prompt Accordion Outer Wrapper & Label Wrap */
#segmented_prompt_accordion_txt2img,
#segmented_prompt_accordion_img2img {
    margin: 4px 0 !important;
    border: none !important;
    background: transparent !important;
}

#segmented_prompt_accordion_txt2img > .label-wrap span,
#segmented_prompt_accordion_img2img > .label-wrap span {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.025em !important;
    color: inherit !important;
}

/* Tools Collapse Button Specifics */
#txt2img_collapse_btn,
#img2img_collapse_btn {
    width: 100% !important;
}

/* --- THEME 1: NATIVE FLUID (CODEX) COLOR TOKENS --- */
body.fluid-theme-codex details.custom-prompt-accordion > summary,
body.fluid-theme-codex .np-wrap.collapsed .np-toggle,
body.fluid-theme-codex .np-wrap:not(.collapsed) .np-bar,
body.fluid-theme-codex .np-toggle,
body.fluid-theme-codex #segmented_prompt_accordion_txt2img > .label-wrap,
body.fluid-theme-codex #segmented_prompt_accordion_img2img > .label-wrap,
body.fluid-theme-codex .fluid-mobile-toggle,
body.fluid-theme-codex #txt2img_collapse_btn,
body.fluid-theme-codex #img2img_collapse_btn {
    background: #202020 !important;
    border: 1px solid #303030 !important;
    color: #d4d4d4 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}

body.fluid-theme-codex details.custom-prompt-accordion > summary:hover,
body.fluid-theme-codex .np-wrap.collapsed .np-toggle:hover,
body.fluid-theme-codex .np-wrap:not(.collapsed) .np-bar:hover,
body.fluid-theme-codex .np-toggle:hover,
body.fluid-theme-codex #segmented_prompt_accordion_txt2img > .label-wrap:hover,
body.fluid-theme-codex #segmented_prompt_accordion_img2img > .label-wrap:hover,
body.fluid-theme-codex .fluid-mobile-toggle:hover,
body.fluid-theme-codex #txt2img_collapse_btn:hover,
body.fluid-theme-codex #img2img_collapse_btn:hover {
    background: #282828 !important;
    border-color: #484848 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

body.fluid-theme-codex .np-wrap:not(.collapsed) {
    background: #1c1c1c !important;
    border: 1px solid #282828 !important;
}

/* --- THEME 2: STUDIO PRO MAX COLOR TOKENS --- */
body.fluid-theme-pro-max details.custom-prompt-accordion > summary,
body.fluid-theme-pro-max .np-wrap.collapsed .np-toggle,
body.fluid-theme-pro-max .np-wrap:not(.collapsed) .np-bar,
body.fluid-theme-pro-max .np-toggle,
body.fluid-theme-pro-max #segmented_prompt_accordion_txt2img > .label-wrap,
body.fluid-theme-pro-max #segmented_prompt_accordion_img2img > .label-wrap,
body.fluid-theme-pro-max .fluid-mobile-toggle,
body.fluid-theme-pro-max #txt2img_collapse_btn,
body.fluid-theme-pro-max #img2img_collapse_btn {
    background: #141824 !important;
    border: 1px solid #283147 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

body.fluid-theme-pro-max details.custom-prompt-accordion > summary:hover,
body.fluid-theme-pro-max .np-wrap.collapsed .np-toggle:hover,
body.fluid-theme-pro-max .np-wrap:not(.collapsed) .np-bar:hover,
body.fluid-theme-pro-max .np-toggle:hover,
body.fluid-theme-pro-max #segmented_prompt_accordion_txt2img > .label-wrap:hover,
body.fluid-theme-pro-max #segmented_prompt_accordion_img2img > .label-wrap:hover,
body.fluid-theme-pro-max .fluid-mobile-toggle:hover,
body.fluid-theme-pro-max #txt2img_collapse_btn:hover,
body.fluid-theme-pro-max #img2img_collapse_btn:hover {
    background: #1d2334 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25) !important;
}

body.fluid-theme-pro-max .np-wrap:not(.collapsed) {
    background: #10141e !important;
    border: 1px solid #232a3d !important;
}

/* --- THEME 3: PURE GRADIO DEFAULT TOKENS --- */
details.custom-prompt-accordion > summary,
.np-wrap.collapsed .np-toggle,
.np-wrap:not(.collapsed) .np-bar,
.np-toggle,
#segmented_prompt_accordion_txt2img > .label-wrap,
#segmented_prompt_accordion_img2img > .label-wrap,
.fluid-mobile-toggle,
#txt2img_collapse_btn,
#img2img_collapse_btn {
    background: var(--button-secondary-background-fill, var(--background-fill-secondary)) !important;
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
    color: var(--button-secondary-text-color, var(--body-text-color)) !important;
}

details.custom-prompt-accordion > summary:hover,
.np-wrap.collapsed .np-toggle:hover,
.np-wrap:not(.collapsed) .np-bar:hover,
.np-toggle:hover,
#segmented_prompt_accordion_txt2img > .label-wrap:hover,
#segmented_prompt_accordion_img2img > .label-wrap:hover,
.fluid-mobile-toggle:hover,
#txt2img_collapse_btn:hover,
#img2img_collapse_btn:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary)) !important;
    color: var(--button-secondary-text-color-hover, var(--body-text-color)) !important;
}

body.fluid-bone-codex-v1 #txt2img_accordions,
body.fluid-bone-codex-v1 #img2img_accordions,
body.fluid-bone-codex-v1 #txt2img_script_container,
body.fluid-bone-codex-v1 #img2img_script_container,
body.fluid-bone-codex-v1 #txt2img_controlnet,
body.fluid-bone-codex-v1 #img2img_controlnet,
body.fluid-bone-codex-v1 .accordions {
    gap: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

body.fluid-bone-codex-v1 #txt2img_controlnet:not(:has(.fluid-drawer-open)),
body.fluid-bone-codex-v1 #img2img_controlnet:not(:has(.fluid-drawer-open)) {
    display: none !important;
}

body.fluid-bone-codex-v1 .fluid-docked-accordion:not(.fluid-drawer-open) {
    display: none !important;
}

/* Open Accordions in Codex v1 Bone: Expand as a focused drawer */
body.fluid-bone-codex-v1 .gradio-accordion:not(.fluid-docked-accordion).open,
body.fluid-bone-codex-v1 .input-accordion:not(.fluid-docked-accordion).input-accordion-open,
body.fluid-bone-codex-v1 .gradio-accordion:not(.fluid-docked-accordion):has(.open),
body.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open {
    display: block !important;
    margin: 6px 0 10px 0 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    animation: fluidFadeSlide 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
    background: var(--block-background-fill, var(--panel-background-fill, var(--background-fill-secondary))) !important;
    border: 1px solid var(--block-border-color, var(--border-color-primary)) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

body.fluid-theme-codex.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open,
body.fluid-theme-codex.fluid-bone-codex-v1 .gradio-accordion:not(.fluid-docked-accordion).open {
    border: 1px solid #383838 !important;
    background: #1c1c1c !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.fluid-theme-pro-max.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open,
body.fluid-theme-pro-max.fluid-bone-codex-v1 .gradio-accordion:not(.fluid-docked-accordion).open {
    border: 1px solid #2b344c !important;
    background: #10141e !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

@keyframes fluidFadeSlide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.fluid-bone-codex-v1 .gradio-accordion:not(.fluid-docked-accordion).open > .label-wrap,
body.fluid-bone-codex-v1 .input-accordion:not(.fluid-docked-accordion).input-accordion-open > .label-wrap,
body.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open > .label-wrap {
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 10px !important;
    border-radius: 5px 5px 0 0 !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    background: var(--background-fill-secondary, var(--panel-background-fill)) !important;
    border-bottom: 1px solid var(--border-color-primary) !important;
}

body.fluid-bone-codex-v1 .gradio-accordion:not(.fluid-docked-accordion).open > .label-wrap span,
body.fluid-bone-codex-v1 .input-accordion:not(.fluid-docked-accordion).input-accordion-open > .label-wrap span,
body.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open > .label-wrap span {
    font-weight: 600 !important;
    font-size: 11.5px !important;
    color: var(--body-text-color, inherit) !important;
}

body.fluid-theme-codex.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open > .label-wrap {
    background: #252525 !important;
    border-bottom: 1px solid #2e2e2e !important;
}

body.fluid-theme-codex.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open > .label-wrap span {
    color: #ffffff !important;
}

body.fluid-theme-pro-max.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open > .label-wrap {
    background: #181d2c !important;
    border-bottom: 1px solid #2b344c !important;
}

body.fluid-theme-pro-max.fluid-bone-codex-v1 .fluid-docked-accordion.fluid-drawer-open > .label-wrap span {
    color: #f1f5f9 !important;
}

/* Open Drawer Header Close Button */
.fluid-drawer-close-btn {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 2px 7px !important;
    margin-left: auto !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    background: var(--button-secondary-background-fill, var(--background-fill-primary)) !important;
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
    color: var(--button-secondary-text-color, var(--body-text-color-subdued, #888888)) !important;
}

body.fluid-theme-codex .fluid-drawer-close-btn {
    color: #888888 !important;
    background: #1e1e1e !important;
    border: 1px solid #333333 !important;
}

body.fluid-theme-codex .fluid-drawer-close-btn:hover {
    color: #ffffff !important;
    background: #2e2e2e !important;
    border-color: #555555 !important;
}

body.fluid-theme-pro-max .fluid-drawer-close-btn {
    color: #94a3b8 !important;
    background: #141824 !important;
    border: 1px solid #283147 !important;
}

body.fluid-theme-pro-max .fluid-drawer-close-btn:hover {
    color: #ffffff !important;
    background: #202738 !important;
    border-color: #6366f1 !important;
}

/* Accordion Interior */
body.fluid-bone-codex-v1 .gradio-accordion > div:not(.label-wrap),
body.fluid-bone-codex-v1 .gr-accordion > div:not(.label-wrap),
body.fluid-bone-codex-v1 .input-accordion > div:not(.label-wrap),
body.fluid-bone-codex-v1 .fluid-docked-accordion > div:not(.label-wrap) {
    padding: 10px !important;
    border-top: none !important;
}

body.fluid-theme-codex.fluid-bone-codex-v1 .fluid-docked-accordion > div:not(.label-wrap),
body.fluid-theme-codex.fluid-bone-codex-v1 .gradio-accordion > div:not(.label-wrap) {
    background: #181818 !important;
}

body.fluid-theme-pro-max.fluid-bone-codex-v1 .fluid-docked-accordion > div:not(.label-wrap),
body.fluid-theme-pro-max.fluid-bone-codex-v1 .gradio-accordion > div:not(.label-wrap) {
    background: #0b0d13 !important;
}

/* Hires Fix & Nested Forms Internal Layout */
body.fluid-bone-codex-v1 #txt2img_hires_fix_row1,
body.fluid-bone-codex-v1 #txt2img_hires_fix_row2,
body.fluid-bone-codex-v1 #txt2img_hires_fix_row_cfg,
body.fluid-bone-codex-v1 #txt2img_hires_fix_row3,
body.fluid-bone-codex-v1 #txt2img_hires_fix_row3b {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 4px 0 !important;
}

body.fluid-bone-codex-v1 #txt2img_hires_fix_row1 > *,
body.fluid-bone-codex-v1 #txt2img_hires_fix_row2 > *,
body.fluid-bone-codex-v1 #txt2img_hires_fix_row_cfg > * {
    flex: 1 1 160px !important;
    min-width: 120px !important;
}


/* ==========================================================================
   MOBILE FLUIDITY (<= 992px & <= 768px Responsive)
   ========================================================================== */
.fluid-mobile-toggle,
.fluid-sheet-header {
    display: none !important;
}

@media (max-width: 992px), (max-width: 768px), (max-device-width: 768px) {
    .fluid-mobile-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 30px !important;
        min-height: 30px !important;
        max-height: 30px !important;
        padding: 0 12px !important;
        margin: 6px 0 8px 0 !important;
        border-radius: 7px !important;
        font-size: 11.5px !important;
        font-weight: 600 !important;
        letter-spacing: 0.02em !important;
        z-index: 100 !important;
        cursor: pointer !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
        transition: all 0.15s ease !important;
        background: var(--button-secondary-background-fill, var(--background-fill-secondary)) !important;
        border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
        color: var(--button-secondary-text-color, var(--body-text-color)) !important;
    }

    body.fluid-theme-codex .fluid-mobile-toggle {
        background: #202020 !important;
        border: 1px solid #303030 !important;
        color: #d4d4d4 !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
    }

    body.fluid-theme-codex .fluid-mobile-toggle:hover,
    body.fluid-theme-codex .fluid-mobile-toggle:active {
        background: #282828 !important;
        border-color: #484848 !important;
        color: #ffffff !important;
    }

    body.fluid-theme-pro-max .fluid-mobile-toggle {
        background: #141824 !important;
        border: 1px solid #2b344c !important;
        color: #e2e8f0 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
    }

    body.fluid-theme-pro-max .fluid-mobile-toggle:hover,
    body.fluid-theme-pro-max .fluid-mobile-toggle:active {
        background: #1d2334 !important;
        border-color: #6366f1 !important;
        color: #ffffff !important;
    }

    /* Mobile Sheet Header & Top Bar */
    .fluid-sheet-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid var(--border-color-primary, rgba(128, 128, 128, 0.2)) !important;
        position: sticky !important;
        top: 0 !important;
        background: var(--panel-background-fill, var(--background-fill-primary)) !important;
        z-index: 100 !important;
        width: 100% !important;
    }

    body.fluid-theme-codex .fluid-sheet-header {
        border-bottom: 1px solid #282828 !important;
        background: #181818 !important;
    }

    body.fluid-theme-pro-max .fluid-sheet-header {
        border-bottom: 1px solid #232a3d !important;
        background: #0b0d13 !important;
    }

    .fluid-sheet-handle {
        width: 40px !important;
        height: 4px !important;
        background: #555555 !important;
        border-radius: 2px !important;
        margin: 0 auto 10px auto !important;
    }

    body.fluid-theme-pro-max .fluid-sheet-handle {
        background: #475569 !important;
    }

    .fluid-sheet-topbar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 4px !important;
    }

    .fluid-sheet-title {
        font-size: 13px !important;
        font-weight: 700 !important;
        letter-spacing: 0.02em !important;
        color: var(--body-text-color, #ffffff) !important;
    }

    .fluid-sheet-done-btn {
        font-size: 11.5px !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        padding: 4px 10px !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        background: var(--button-secondary-background-fill, var(--background-fill-secondary)) !important;
        border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
        color: var(--button-secondary-text-color, var(--body-text-color)) !important;
    }

    body.fluid-theme-codex .fluid-sheet-done-btn {
        background: #272727 !important;
        border: 1px solid #383838 !important;
        color: #e5e5e5 !important;
    }

    body.fluid-theme-codex .fluid-sheet-done-btn:hover {
        background: #333333 !important;
        color: #ffffff !important;
    }

    body.fluid-theme-pro-max .fluid-sheet-done-btn {
        background: #191e2e !important;
        border: 1px solid #2b344c !important;
        color: #e2e8f0 !important;
    }

    body.fluid-theme-pro-max .fluid-sheet-done-btn:hover {
        background: #22293e !important;
        color: #ffffff !important;
        border-color: #6366f1 !important;
    }

    #txt2img_settings, #img2img_settings {
        position: fixed !important;
        bottom: 0px !important;
        left: 0 !important;
        width: 100vw !important;
        height: 50vh !important;
        max-height: 50vh !important;
        z-index: 10001 !important;
        transform: translateY(105%) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 16px 16px 0 0 !important;
        padding: 10px 14px 60px 14px !important;
        background: var(--body-background-fill, var(--background-fill-primary)) !important;
        border-top: 1px solid var(--border-color-primary, #333333) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7) !important;
    }

    body.fluid-theme-codex #txt2img_settings,
    body.fluid-theme-codex #img2img_settings {
        background: #181818 !important;
        border-top: 1px solid #333333 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.95) !important;
    }

    body.fluid-theme-pro-max #txt2img_settings,
    body.fluid-theme-pro-max #img2img_settings {
        background: #0b0d13 !important;
        border-top: 1px solid #232a3d !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.95) !important;
    }

    body.fluid-sheet-open #txt2img_settings,
    body.fluid-sheet-open #img2img_settings {
        transform: translateY(0) !important;
    }

    #txt2img_generate_box, #img2img_generate_box {
        position: fixed !important;
        bottom: 12px !important;
        left: 12px !important;
        width: calc(100vw - 24px) !important;
        z-index: 10000 !important;
        height: 50px !important;
        min-height: 0 !important;
        max-height: 50px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 6px !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        padding: 4px !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
        background: var(--panel-background-fill, rgba(20, 20, 20, 0.95)) !important;
        border: 1px solid var(--border-color-primary, rgba(255, 255, 255, 0.12)) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
    }

    body.fluid-theme-codex #txt2img_generate_box,
    body.fluid-theme-codex #img2img_generate_box {
        background: rgba(20, 20, 20, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.85) !important;
    }

    body.fluid-theme-pro-max #txt2img_generate_box,
    body.fluid-theme-pro-max #img2img_generate_box {
        background: rgba(15, 18, 27, 0.92) !important;
        border: 1px solid rgba(99, 102, 241, 0.25) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 15px rgba(99, 102, 241, 0.15) !important;
    }

    .fluid-backdrop {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,0.65) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        z-index: 9998 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
    }

    body.fluid-sheet-open .fluid-backdrop {
        opacity: 1 !important;
        pointer-events: all !important;
    }
}

/* Gradio Dropdown Fix */
.gr-dropdown-list,
.options,
ul.options,
.gradio-dropdown ul,
.svelte-10z6qve ul {
    z-index: 999999 !important;
}

/* ==========================================================================
   QUICKSETTINGS & TOP BAR
   ========================================================================== */
.qs-wrap {
    margin-bottom: 8px !important;
    border-radius: 8px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    background: var(--panel-background-fill, var(--block-background-fill, var(--background-fill-secondary))) !important;
    border: 1px solid var(--panel-border-color, var(--block-border-color, var(--border-color-primary))) !important;
}

body.fluid-theme-codex .qs-wrap {
    border: 1px solid #282828 !important;
    background: #1c1c1c !important;
}

body.fluid-theme-pro-max .qs-wrap {
    border: 1px solid #232a3d !important;
    background: #111520 !important;
}

.qs-bar {
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
}

.qs-toggle {
    width: 100% !important;
    height: 26px !important;
    min-height: 26px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    padding: 0 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    background: var(--background-fill-secondary, var(--panel-background-fill)) !important;
    border-bottom: 1px solid var(--border-color-primary, rgba(128, 128, 128, 0.2)) !important;
    color: var(--body-text-color-subdued, #888888) !important;
}

.qs-toggle:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary)) !important;
}

body.fluid-theme-codex .qs-toggle {
    color: #888888 !important;
    background: #202020 !important;
    border-bottom: 1px solid #282828 !important;
}

body.fluid-theme-codex .qs-toggle:hover {
    color: #ffffff !important;
    background: #282828 !important;
}

body.fluid-theme-pro-max .qs-toggle {
    color: #94a3b8 !important;
    background: #141824 !important;
    border-bottom: 1px solid #232a3d !important;
}

body.fluid-theme-pro-max .qs-toggle:hover {
    color: #ffffff !important;
    background: #1a2030 !important;
}

.qs-wrap.collapsed .qs-toggle {
    border-bottom: none !important;
}

/* Hiding logic for collapsed state */
.qs-wrap.collapsed > #quicksettings,
.qs-wrap.collapsed > .quicksettings,
.qs-wrap.collapsed > [id*="quicksettings"] {
    display: none !important;
}

/* Quicksettings Container Flow (when open) */
.qs-wrap:not(.collapsed) > #quicksettings,
#quicksettings:not(.qs-wrap.collapsed > #quicksettings) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
}

body.fluid-theme-codex .qs-wrap:not(.collapsed) > #quicksettings,
body.fluid-theme-codex #quicksettings:not(.qs-wrap.collapsed > #quicksettings) {
    background: #181818 !important;
}

body.fluid-theme-pro-max .qs-wrap:not(.collapsed) > #quicksettings,
body.fluid-theme-pro-max #quicksettings:not(.qs-wrap.collapsed > #quicksettings) {
    background: #0b0d13 !important;
}

#quicksettings > * {
    flex: 1 1 180px !important;
    min-width: 150px !important;
    margin: 0 !important;
}

#quicksettings > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

#quicksettings .gradio-dropdown,
#quicksettings div[class*="dropdown"],
#quicksettings .svelte-10z6qve,
#quicksettings #setting_sd_modules,
#quicksettings #setting_sd_modules div.wrap-inner,
#quicksettings #setting_sd_modules .secondary-wrap {
    position: relative !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
}

#quicksettings #setting_sd_modules {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

#quicksettings #setting_sd_modules div.wrap-inner {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    padding: 3px 26px 3px 6px !important;
    overflow: hidden !important;
}

#quicksettings label {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    margin-bottom: 3px !important;
}

body.fluid-theme-codex #quicksettings label {
    color: #888888 !important;
}

body.fluid-theme-pro-max #quicksettings label {
    color: #94a3b8 !important;
}

/* Quicksettings Input Overrides (Codex & Pro Max) */
body.fluid-theme-codex #quicksettings input,
body.fluid-theme-codex #quicksettings select,
body.fluid-theme-codex #quicksettings .secondary-wrap {
    background-color: #242424 !important;
    border: 1px solid #333333 !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 12px !important;
}

body.fluid-theme-pro-max #quicksettings input,
body.fluid-theme-pro-max #quicksettings select,
body.fluid-theme-pro-max #quicksettings .secondary-wrap {
    background-color: #141824 !important;
    border: 1px solid #2b344c !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 12px !important;
}

/* Multi-Select Chips (VAE / Text Encoders) */
#quicksettings .token,
#quicksettings .token-remove,
#quicksettings div.token {
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    margin: 2px 0 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.fluid-theme-codex #quicksettings .token,
body.fluid-theme-codex #quicksettings .token-remove,
body.fluid-theme-codex #quicksettings div.token {
    background: #2a2a2a !important;
    border: 1px solid #3a3a3a !important;
    color: #e5e5e5 !important;
}

body.fluid-theme-pro-max #quicksettings .token,
body.fluid-theme-pro-max #quicksettings .token-remove,
body.fluid-theme-pro-max #quicksettings div.token {
    background: #191e2e !important;
    border: 1px solid #2b344c !important;
    color: #cbd5e1 !important;
}

#quicksettings .token span:not(.token-remove),
#quicksettings div.token span:not(.token-remove) {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

#quicksettings .token .token-remove,
#quicksettings div.token .token-remove {
    flex: 0 0 auto !important;
    margin-left: 4px !important;
    cursor: pointer !important;
}

#quicksettings button.tool {
    flex: 0 0 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    align-self: flex-end !important;
    margin-bottom: 2px !important;
}

body.fluid-theme-codex #quicksettings button.tool {
    background: #242424 !important;
    border: 1px solid #333333 !important;
    color: #d4d4d4 !important;
}

body.fluid-theme-codex #quicksettings button.tool:hover {
    background: #303030 !important;
    border-color: #555555 !important;
    color: #ffffff !important;
}

body.fluid-theme-pro-max #quicksettings button.tool {
    background: #141824 !important;
    border: 1px solid #2b344c !important;
    color: #cbd5e1 !important;
}

body.fluid-theme-pro-max #quicksettings button.tool:hover {
    background: #1f2535 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
}

/* Quicksettings Unload Trash Button */
#fluid_unload_models_btn {
    color: #ff5555 !important;
    border-color: rgba(255, 85, 85, 0.4) !important;
    cursor: pointer !important;
}

#fluid_unload_models_btn:hover {
    background: rgba(255, 85, 85, 0.15) !important;
    border-color: #ff5555 !important;
}

#fluid_unload_models_btn.btn-success {
    border-color: #22c55e !important;
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.15) !important;
}

/* Side-by-side Generate & Action Buttons Bar */
#txt2img_generate_box,
#img2img_generate_box {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    height: 44px !important;
    min-height: 0 !important;
    max-height: 44px !important;
    margin-bottom: 8px !important;
    box-sizing: border-box !important;
}

#txt2img_generate,
#img2img_generate {
    flex: 2 1 0 !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 0 !important;
    max-height: 44px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

.fluid-float-action-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 0 !important;
    max-height: 44px !important;
    padding: 2px 6px !important;
    box-sizing: border-box !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    background: var(--button-secondary-background-fill, var(--background-fill-secondary)) !important;
    border: 1px solid var(--button-secondary-border-color, var(--border-color-primary)) !important;
    color: var(--button-secondary-text-color, var(--body-text-color)) !important;
}

.fluid-float-action-btn:hover {
    background: var(--button-secondary-background-fill-hover, var(--background-fill-primary)) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

.fluid-float-action-btn:active {
    transform: translateY(0) !important;
}

body.fluid-theme-codex .fluid-float-action-btn {
    background: #202020 !important;
    border: 1px solid #333333 !important;
    color: #e0e0e0 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

body.fluid-theme-codex .fluid-float-action-btn:hover {
    border-color: #555555 !important;
    background: #2a2a2a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4) !important;
}

body.fluid-theme-pro-max .fluid-float-action-btn {
    background: #141824 !important;
    border: 1px solid #283147 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

body.fluid-theme-pro-max .fluid-float-action-btn:hover {
    border-color: #6366f1 !important;
    background: #1e2436 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
}

.fluid-float-action-btn.btn-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15) !important;
}

@media (max-width: 860px) {
    #txt2img_generate_box,
    #img2img_generate_box {
        position: fixed !important;
        bottom: 12px !important;
        left: 12px !important;
        width: calc(100vw - 24px) !important;
        height: 50px !important;
        z-index: 10000 !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        padding: 4px !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        background: var(--panel-background-fill, rgba(20, 20, 20, 0.95)) !important;
        border: 1px solid var(--border-color-primary, rgba(255, 255, 255, 0.12)) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
    }

    body.fluid-theme-codex #txt2img_generate_box,
    body.fluid-theme-codex #img2img_generate_box {
        background: rgba(20, 20, 20, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.85) !important;
    }

    body.fluid-theme-pro-max #txt2img_generate_box,
    body.fluid-theme-pro-max #img2img_generate_box {
        background: rgba(15, 18, 27, 0.92) !important;
        border: 1px solid rgba(99, 102, 241, 0.25) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 15px rgba(99, 102, 241, 0.15) !important;
    }

    #txt2img_generate,
    #img2img_generate {
        height: 100% !important;
        flex: 1.6 1 0 !important;
        border-radius: 10px !important;
        font-size: 13px !important;
    }

    .fluid-float-action-btn {
        height: 100% !important;
        flex: 1 1 0 !important;
        border-radius: 10px !important;
        font-size: 10.5px !important;
        padding: 2px 2px !important;
    }
}
